package cn.doitedu.datayiee.rest.utils;

import java.sql.Connection;
import java.sql.Driver;
import java.util.Properties;

public class KylinUtil {

    private static Connection connection = null;

    public static Connection getKylinConnection() throws Exception {
        if(connection==null) {
            Driver driver = (Driver) Class.forName("org.apache.kylin.jdbc.Driver").newInstance();

            Properties prop = new Properties();
            prop.setProperty("user", "ADMIN");
            prop.setProperty("password", "KYLIN");
            connection = driver.connect("jdbc:kylin://doitedu03:7070/pv_analitic_model", prop);
        }
        return connection;
    }
}
